//
//  NSArray+Extras.m
//  SEOBox
//
//  Created by Syd on 10-3-2.
//  Copyright 2010 MusicPeace.ORG. All rights reserved.
//

#import "NSArray+Extras.h"


@implementation NSArray (Extras)

- (unsigned int) countOccurrencesOfObject:(id) object
{
    unsigned int   count;
    unsigned int   hash;
    unsigned int   i, n;
    id             p;
    
    count = 0;
    hash  = [object hash];
    
    n = [self count];
    for( i = 0; i < n; i++)
    {
        p = [self objectAtIndex:i];
        if( [p hash] == hash)
            if( [p isEqual:object])
                ++count;     
    }
    return( count);
}

@end
